﻿Public Class Inicio

    Private Sub btnCategoria_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCategoria.Click
        If My.Forms.frmCategoria.IsDisposed = False Then
            My.Forms.frmCategoria.BringToFront()
        End If
        My.Forms.frmCategoria.MdiParent = Me
        My.Forms.frmCategoria.Show()
    End Sub

    Private Sub btnEmpleados_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEmpleados.Click
        If My.Forms.frmEmpleado.IsDisposed = False Then
            My.Forms.frmEmpleado.BringToFront()
        End If
        My.Forms.frmEmpleado.MdiParent = Me
        My.Forms.frmEmpleado.Show()
    End Sub

    Private Sub btnEmpresa_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEmpresa.Click
        If My.Forms.frmEmpresa.IsDisposed = False Then
            My.Forms.frmEmpresa.BringToFront()
        End If
        My.Forms.frmEmpresa.MdiParent = Me
        My.Forms.frmEmpresa.Show()
    End Sub

    Private Sub btnMotivo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMotivo.Click
        If My.Forms.frmMotivo.IsDisposed = False Then
            My.Forms.frmMotivo.BringToFront()
        End If
        My.Forms.frmMotivo.MdiParent = Me
        My.Forms.frmMotivo.Show()
    End Sub

    Private Sub btnAlmacen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAlmacen.Click
        If My.Forms.frmAlmacen.IsDisposed = False Then
            My.Forms.frmAlmacen.BringToFront()
        End If
        My.Forms.frmAlmacen.MdiParent = Me
        My.Forms.frmAlmacen.Show()
    End Sub

    Private Sub btnProducto_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnProducto.Click
        If My.Forms.frmProducto.IsDisposed = False Then
            My.Forms.frmProducto.BringToFront()
        End If
        My.Forms.frmProducto.MdiParent = Me
        My.Forms.frmProducto.Show()
    End Sub

    Private Sub btnDepartamento_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDepartamento.Click
        Dim frm As frmUbigeo = frmUbigeo.Instance(1)
        frm.MdiParent = Me
        frmUbigeo.tipoUbigeo = 1
        frm.Show()
    End Sub

    Private Sub btnProvincia_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnProvincia.Click
        Dim frm As frmUbigeo = frmUbigeo.Instance(2)
        frm.MdiParent = Me
        frmUbigeo.tipoUbigeo = 2
        frm.Show()
    End Sub

    Private Sub btnDistrito_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDistrito.Click
        Dim frm As frmUbigeo = frmUbigeo.Instance(3)
        frm.MdiParent = Me
        frmUbigeo.tipoUbigeo = 3
        frm.Show()
    End Sub

    Private Sub btnUsuarios_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUsuarios.Click
        My.Forms.frmUsuario.MdiParent = Me
        My.Forms.frmUsuario.Show()
    End Sub

    Private Sub btnSalir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSalir.Click
        Me.Close()
    End Sub

    Private Sub btnCascada_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCascada.Click
        Me.LayoutMdi(MdiLayout.Cascade)
    End Sub

    Private Sub btnMosaicoVertical_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMosaicoVertical.Click
        Me.LayoutMdi(MdiLayout.TileVertical)
    End Sub

    Private Sub btnMosaicoHorizontal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMosaicoHorizontal.Click
        Me.LayoutMdi(MdiLayout.TileHorizontal)
    End Sub

    Private Sub btnCerrarTodo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCerrarTodo.Click
        For Each ChildForm As Form In Me.MdiChildren
            ChildForm.Close()
        Next
    End Sub

    Private Sub CBBarraEstado_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CBBarraEstado.Click
        Me.Bar1.Visible = Me.CBBarraEstado.Checked
    End Sub

    Private Sub CBCintaOpciones_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CBCintaOpciones.Click

    End Sub

    Private Sub btnRegiEntradastrar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRegiEntradastrar.Click
        Dim frm As frmMovimientoAlmacen = frmMovimientoAlmacen.Instance("E")
        frm.MdiParent = Me
        frm.Show()
    End Sub

    Private Sub ButtonItem13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem13.Click
        My.Forms.frmReporte.MdiParent = Me
        My.Forms.frmReporte.Show()
    End Sub

    Private Sub btnRegistrarSalida_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRegistrarSalida.Click
        Dim frm As frmMovimientoAlmacen = frmMovimientoAlmacen.Instance("S")
        frm.MdiParent = Me
        frm.Show()

    End Sub

    Private Sub btnGenerarGuia_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGenerarGuia.Click
        My.Forms.frmGuiaRemision.MdiParent = Me
        My.Forms.frmGuiaRemision.Show()
    End Sub

    Private Sub btnProveedor_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnProveedor.Click
        My.Forms.frmProveedor.MdiParent = Me
        My.Forms.frmProveedor.Show()
    End Sub

    Private Sub Inicio_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        My.Forms.AutenticarUsuario.Close()
    End Sub

End Class